package edu.uts.reekie.designer.conceptual;

import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.actions.GEFActionConstants;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;

import edu.uts.reekie.designer.*;
import edu.uts.reekie.designer.conceptual.actions.*;

public class ContextMenuProvider extends AbstractContextMenuProvider {

	public ContextMenuProvider(EditPartViewer viewer, ActionRegistry registry) {
		super(viewer, registry);
		// TODO Auto-generated constructor stub
	}

	protected void addToContextMenu(IMenuManager manager) {
		IAction action = getActionRegistry().getAction(SetUnsetComponentPersistenceStereotypeAction.getSetId());
		if (action.isEnabled())
			manager.appendToGroup(GEFActionConstants.GROUP_REST, action);
		
		action = getActionRegistry().getAction(SetUnsetComponentPersistenceStereotypeAction.getUnsetId());
		if (action.isEnabled())
			manager.appendToGroup(GEFActionConstants.GROUP_REST, action);
		
		
		action = getActionRegistry().getAction(SetUnsetComponentRealTimeStereotypeAction.getSetId());
		if (action.isEnabled())
			manager.appendToGroup(GEFActionConstants.GROUP_REST, action);
		
		
		action = getActionRegistry().getAction(SetUnsetComponentRealTimeStereotypeAction.getUnsetId());
		if (action.isEnabled())
			manager.appendToGroup(GEFActionConstants.GROUP_REST, action);
		
		
		action = getActionRegistry().getAction(SetUnsetComponentPresentationStereotypeAction.getSetId());
		if (action.isEnabled())
			manager.appendToGroup(GEFActionConstants.GROUP_REST, action);
		
		
		action = getActionRegistry().getAction(SetUnsetComponentPresentationStereotypeAction.getUnsetId());
		if (action.isEnabled())
			manager.appendToGroup(GEFActionConstants.GROUP_REST, action);
		
		
			
		
	}

}
